package com.wutao.panzh.admin.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.panzh.entity.HotelClassification;
import com.wutao.panzh.admin.mapper.HotelClassificationMapper;
import com.wutao.panzh.service.HotelClassificationService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.jar.JarEntry;

@Service
public class HotelClassificationServiceImpl implements HotelClassificationService {

    @Autowired
    private HotelClassificationMapper hotelClassificationMapper;

    @Override
    public List<HotelClassification> getAllClassIfication() {
        List<HotelClassification> list = hotelClassificationMapper.selectAll();
        return list;
    }

    @Override
    public void insertHotelClassification(String classificationName) {
        HotelClassification hotelClassification = new HotelClassification();
        hotelClassification.setCategorizationInformation(classificationName);
        hotelClassificationMapper.insert(hotelClassification);

    }

    @Override
    public void deleteHotelClassification(String itemId) {
        HotelClassification hotelClassification = new HotelClassification();
        hotelClassification.setId(Integer.parseInt(itemId));
        hotelClassificationMapper.delete(hotelClassification);

    }
}
